<?php
$ma='/test/';
$str='testdddtest';
var_dump(preg_match_all($ma,$str,$res));
echo "<hr>";
var_dump($res);